<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:core="http://www.contact.core.com/contacts/core/ui"
        >

<ui:component>

    <h:form id="userForm">
        <h:panelGroup style="width:400px">
            <rich:toolBar id="userToolBar" width="100%">
                <rich:toolBarGroup>
                    <a4j:commandButton id="createUserButton"
                                       value="#{resources.addLabel}"
                                       reRender="userInfoModalPanel"
                                       action="#{userInfoBean.prepareToAddUser}"
                                       oncomplete="Richfaces.showModalPanel('userInfoModalPanel');"
                                       limitToList="true">
                    </a4j:commandButton>

                    <a4j:commandButton id="updateUserButton"
                                       value="#{resources.updateLabel}"
                                       reRender="userInfoModalPanel"
                                       action="#{userInfoBean.prepareToUpadateUser}"
                                       limitToList="true"
                                       oncomplete="if(data)Richfaces.showModalPanel('userInfoModalPanel');"
                                       data="#{userInfoBean.selected}">


                    </a4j:commandButton>
                    <!--data="#{data}"-->
                    <a4j:commandButton id="deleteUserButton"
                                       value="#{resources.deleteLabel}"
                                       reRender="confirmUserInfoModalPanel"
                                       action="#{userInfoBean.prepareToDeleteUser}"
                                       oncomplete="if(data)Richfaces.showModalPanel('confirmUserInfoModalPanel');"
                                       data="#{userInfoBean.selected}"
                                       limitToList="true">
                    </a4j:commandButton>
                </rich:toolBarGroup>
            </rich:toolBar>
            <core:userInfoTable/>
        </h:panelGroup>

    </h:form>

    <core:userInfoEdit reRender="userForm"/>
    <core:confirmUsetInfoPanel reRender = "userForm"/>

</ui:component>


</html>